#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "mythread.h"

#include <QMainWindow>
#include <QGraphicsScene>
#include <QKeyEvent>
#include <qthread.h>
#include <QTimer>
#include <QTime>
#include <QMessageBox>
#include <QFile>
#include <QGraphicsItem>
#include <QTextStream>
#include <QThread>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void startThread();
    void drowGraphicItem(QGraphicsItem* item);
    void stopThread();

private:
    Ui::MainWindow *ui;
    QGraphicsScene *scene;
    QTimer *timer;
    QList<QGraphicsItem*> list;
    MyThread* thread;

    bool keepGen = false;
    int transparancy = 255;
    bool threadActive = false;

    void saveData();
    void loadData();
    void changeTransparency();
    void saveDataToPixMap();



    void keyPressEvent(QKeyEvent *event);
};

#endif // MAINWINDOW_H
